package apralms

class Scheme {
	String code
	String name
	
	String calMode1
	String calMode2
	
	float runTime = 0
	
	Date dateCreated
	Date lastUpdated

	static constraints = {
		code blank:false, maxSize:10, unique:true
		name blank:false, maxSize:50, unique:true
		
		runTime  min:0f, max:10000f
		
		calMode1 blank: false, inList:['0', '1', '2', '3', '4']
		calMode2 blank: false, inList:['0', '1', '2', '3', '4']
	}
	
	static belongsTo = [project:Project]
	static hasMany = [projectIndexes:ProjectIndex, systemIndexes:SystemIndex, productIndexes:ProductIndex,
		systemFacts:SystemFact, productFacts:ProductFact]
	
	String toString(){
		"${name}[${code}]"
	}
}
